package com.example.controller;

import com.example.entity.Auth;
import com.example.entity.Result;
import com.example.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:tjf
 * @Description:
 */
@RequestMapping("/auth")
@RestController
public class AuthController {
    @Autowired
    AuthService authService;
    /**
     * 获取由所有权限转为权限树接口url/auth/auth-tree
     * @return
     */
    @RequestMapping("/auth-tree")
    public Result getAuthTree(){
        List<Auth> authList = authService.transformAllAuthToAuthTree();

        return Result.ok(authList);
    }
}
